#ifndef EGG_TIMER_H
#define	EGG_TIMER_H

#include "Base.h"
#include <Windows.h>
#include <MMSystem.h>

namespace egg {

    class Timer {
    public:
		Timer(){
			QueryPerformanceFrequency(&mFrequency);
		}

        inline double getSeconds() {
			LARGE_INTEGER time;
			QueryPerformanceCounter(&time);
			return ((double)time.QuadPart)/mFrequency.QuadPart;
        }

        inline double getMilliseconds() {
            return getSeconds()*1000.0;
        }

		inline double getMicrosecond(){
			return getMilliseconds()*1000.0;
		}

	protected:
		LARGE_INTEGER mFrequency;
    };

    extern Timer gTimer;

}

#endif	/* TIMER_H */

